import React from 'react'
import { useCounterStore } from '../../app/store'

export default function Counter() {
  const { value, increment, decrement } = useCounterStore()

  return (
    <div>
      <div>
        <button aria-label="Increment value" onClick={increment}>
          Increment
        </button>
        <span>{value}</span>
        <button aria-label="Decrement value" onClick={decrement}>
          Decrement
        </button>
      </div>
    </div>
  )
}